<template>
	<!-- 云电话 -->
	<view class="bg-white">
		
		<!-- 主体内容 -->
		<view class="padding">
			<!-- 标题 -->
			<view v-if="!isIntroduceDetail">
			<view class="text-xl text-primary">{{$t('JLink.groups.xmcVoes')}}</view>
			<view class="text-primary text-sm margin-tb-xs">{{$t('JLink.describe.xmcVoes.introduce')}}</view>
			</view>
			<!-- 支持开通的设备列表 -->
			<device-list v-if="!isIntroduceDetail" :supportDeviceObj="supportDeviceObj" @click="handleSelectDevice">
			
				<template #default>
					<!-- 操作 -->
					<pmsOrVoesAction v-if="buttonMessage.message.expireTime" :list="actionList" :message="buttonMessage.message"></pmsOrVoesAction>
				</template>
			</device-list>
			<!-- logo -->
			<!-- <image :src="isDoorbells?'https://statics.xmcsrv.net/weixin/cloud/xmcVoes/zh/doorbells.gif':`https://statics.xmcsrv.net/weixin/cloud/xmcVoes/zh/logo.png`" style="width:100%;" mode="widthFix"></image> -->
			<!-- 广告 -->
			<ads :title="$t('JLink.describe.xmcVoes.ads.title')" :list="adList" pathName="xmcVoes"></ads>
		</view>
		<!-- 按钮 -->
		<buttons v-if="buttonMessage.fail"  :classifyId="classifyId" :message="buttonMessage.message"></buttons>
	</view>
</template>

<script>
import {getDevice} from './mixins'
import pmsOrVoesAction from './module/pmsOrVoesAction/pmsOrVoesAction'
import buttons from './module/buttons/buttons'
import ads from './module/ads/ads'
import deviceList from './module/deviceList/deviceList'
export default {
	mixins: [getDevice],
	components: {
	   pmsOrVoesAction,
	   deviceList,
	   buttons,
	   ads
	},
	props:{
		deviceInfo:{
			type:Object,
			default:()=>{
				return {
					modalName:null
				}
			}
		}
	},
	data() {
		return {
			isIntroduceDetail:false,
			// 广告列表
			adList:[
				{col:4,list:[
					{url:'doorbell1.gif',title:this.$t('JLink.describe.xmcVoes.ads.content.name1'),text:this.$t('JLink.describe.xmcVoes.ads.content.text1'),show:true,icon:1},
					{url:'doorbell2.gif',title:this.$t('JLink.describe.xmcVoes.ads.content.name2'),text:this.$t('JLink.describe.xmcVoes.ads.content.text2'),show:true,icon:2},
					{url:'doorbell3.png',title:this.$t('JLink.describe.xmcVoes.ads.content.name3'),text:this.$t('JLink.describe.xmcVoes.ads.content.text3'),show:true,icon:3},
					{url:'4.png',title:this.$t('JLink.describe.xmcVoes.ads.content.name4'),text:this.$t('JLink.describe.xmcVoes.ads.content.text4'),show:true,icon:4}
				]},
			],
			actionList:[
				{name:this.$t('JLink.configs.phones'),icon:'setPhones',class:'text-left',type:'voes'},
				{name:this.$t('JLink.configs.record'),icon:'record',class:'text-right',type:'voes'},
				{name:this.$t('JLink.configs.alramConfig'),icon:'alarmType',class:'text-right',type:'voes'},
			],
		}
	},
	mounted(){
		if(this.deviceInfo){
			this.isIntroduceDetail = this.deviceInfo.isIntroduceDetail
		}
	},
    onLoad(opt) {
    },
    onShow() {
	},
    methods: {
		change(e) {
			this.current = e.detail.current
		},
		clickItem(e) {
			this.swiperDotIndex = e
		},
		
    }
}
</script>

<style lang="less" scoped>
	@import '@/common/style/main.css';
</style>